package cn.cycleif.app.service;

import cn.cycleif.app.mapper.RoleMapper;
import cn.cycleif.app.mapper.UserRoleMapper;
import cn.cycleif.entity.Role;
import cn.cycleif.util.R;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Date: 25/1/21-16:46
 * @Desc:
 */
@Service
public class RoleService extends ServiceImpl<RoleMapper, Role> {

  @Autowired
  private RoleMapper     roleMapper;
  @Autowired
  private UserRoleMapper userRoleMapper;

  public R<List<Role>> getRolesByUserId(Integer userId) {
    List<Role> list = roleMapper.findRoleListByUserId(userId);
    return R.success(list);
  }

}
